function createWeirdScaleFunction(FACTOR) {
    return function (v) {
        this['FACTOR'] = FACTOR;
        let captures = this;

        console.log(this);
        return v.map(function (n) {
            return n * this['FACTOR'];
        }.bind(captures));
    };
}

const obj = {
    createWeirdScaleFunction
}

console.log(obj.createWeirdScaleFunction(10)([1, 2, 3]));

function complement(PRED) {
    return (...args) => {
        return !PRED(...args);
    };
}

function isEven(n) {
    return n % 2 === 0;
}

function plucker(FILED) {
    return obj => {
        return obj && obj[FILED];
    };
}

const getFile = plucker('title');
console.log([{title: 'Tom'}, {title: 'Jack'}, {name: 'Lisa'}].filter(getFile));